{extend name="public/base"/}
{block name="style"}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
{/block}
{block name="body"}
<div class="main-box clearfix">
    <header class="main-box-header clearfix">
        <div class="pull-left">
            <ul class="nav nav-tabs">
                <li>
                    <a href="{:url('admin/group/index')}">部门管理</a>
                </li>
                <li>
                    <a href="{:url('admin/group/access')}">权限节点</a>
                </li>
                <li class="active">
                    <a href="{:url('admin/group/situation')}">岗位管理</a>
                </li>

            </ul>
        </div>
        <div class="pull-right">
            <a href="{:url('Group/addSituation',array('type'=>$type))}" class="btn btn-danger"> 添加</a>
        </div>
    </header>
    <div class="main-box-body clearfix">
        <div class="tabs-wrapper">

            <div class="tab-content">
                <div class="tab-pane fade in active" id="tab-home">
                    {if condition="empty($list)"}
                    <p>暂无数据！</p>
                    {else/}
                    <div class="table-responsive clearfix">
                        <table class="table table-striped table-hover">
                            <thead>
                            <tr>
                                <th width="30"><input class="checkbox check-all" type="checkbox"></th>
                                <th width="60">ID</th>
                                <th>岗位</th>
                                <th>描述</th>
                                <th>所属部门</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="item"}
                            <tr>
                                <td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$item['id']}"></td>
                                <td>{$item['id']}</td>
                                <td><a href="#" class="editable editable-click" data-id="{$item['id']}" data-name="title" data-type="text">{$item['title']}</a></td>
                                <td>{$item['description']}</td>
                                <td>{$item['situation']}</td>
                                <td>
                                    {if condition="$item['status'] eq '0'"}
                                    <span class="label label-danger">禁用</span>
                                    {elseif condition="$item['status'] eq '1'"/}
                                    <span class="label label-primary">启用</span>
                                    {/if}
                                </td>
                                <td>
                                    <a href="{:url('Group/editSituation',array('id'=>$item['id']))}">编辑</a>
                                    <a href="{:url('Group/del',array('id'=>$item['id']))}" class="confirm ajax-get">删除</a>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {$page}
                    </div>
                    {/if}
                </div>
            </div>
        </div>
    </div>
</div>

{/block}
{block name="script"}
<script type="text/javascript" src="__PUBLIC__/js/bootstrap-editable.min.js"></script>
<script type="text/javascript">
    $(function(){
        $.fn.editable.defaults.mode = 'popup';
        $.fn.editableform.buttons = '<button type="submit" class="btn btn-success editable-submit btn-mini"><i class="fa fa-check-square-o fa-white"></i></button>' +
            '<button type="button" class="btn editable-cancel btn-mini"><i class="fa fa-times"></i></button>';
        $('.editable').editable();
    })
</script>
{/block}